import request from '@/utils/request'

// 创建巡检计划
export function createInspectionPlan(data) {
  return request({
    url: '/device/inspection-plan/create',
    method: 'post',
    data: data
  })
}

// 更新巡检计划
export function updateInspectionPlan(data) {
  return request({
    url: '/device/inspection-plan/update',
    method: 'put',
    data: data
  })
}

// 删除巡检计划
export function deleteInspectionPlan(id) {
  return request({
    url: '/device/inspection-plan/delete?id=' + id,
    method: 'delete'
  })
}

// 获得巡检计划
export function getInspectionPlan(id) {
  return request({
    url: '/device/inspection-plan/get?id=' + id,
    method: 'get'
  })
}

// 获得巡检计划分页
export function getInspectionPlanPage(query) {
  return request({
    url: '/device/inspection-plan/page',
    method: 'get',
    params: query
  })
}

// 导出巡检计划 Excel
export function exportInspectionPlanExcel(query) {
  return request({
    url: '/device/inspection-plan/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
